<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
	<title>编辑图文</title>
	<link rel="stylesheet" href="__PUBLIC__/Policy/css/weui.min.css">
	<link rel="stylesheet" href="__PUBLIC__/Policy/css/bootstrap.min.css">
	<script src="__PUBLIC__/Policy/js/jquery-1.8.2.min.js"></script>
	
</head>
<body>



<div style="text-align: center;margin-top:4%; margin-bottom:4%">
	<img src="__PUBLIC__/Policy/img/logo.png" alt="logo" width="40%">
</div>

<form action="" method="post">
	<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">图文标题</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="text" name="content"  placeholder="{$data['content']}"/>
        </div>
    </div>
       <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">图文链接</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="text"  name="link"  placeholder="{$data['link']}"/>
            <input class="weui-input" type="hidden"  name="id"  value="{$data['id']}" />
        </div>
    </div>
</div>
<table class="table">
	<tr>
		<td>
			<button type="reset" class="weui-btn weui-btn_warn">重新填写</a>
		</td>
		<td>
			
			<button  type="button" class="weui-btn weui-btn_primary submits" >确认提交</a>
		</td>
		</td>
	</tr>
</table>
</form>
	<div class="weui-loadmore" style="display:none">
	    <i class="weui-loading"></i>
	    <span class="weui-loadmore__tips">正在提交中！</span>
	</div>

           <div class="weui-footer " id="footer">
                    <p class="weui-footer__links">
                        <a href="javascript:void(0);" class="weui-footer__link">中国航天-神舟软件</a>
                    </p>
                    <p class="weui-footer__text">Copyright &copy; 2008-2016 </p>
            </div> 

<div class="js_dialog" id="iosDialog2" style="display: none;">
                <div class="weui-mask"></div>
                <div class="weui-dialog">
                    <div class="weui-dialog__bd"></div>
                    <div class="weui-dialog__ft">
                        <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id="qr">确定</a>
                    </div>
                </div>
            </div>


</body>
<script>
	$(function(){
		

		$('.submits').click(function(){
			var content = $('input[name=content]').val();
			var link = $('input[name=link]').val();
			var id = $('input[name=id]').val();
			//$('.weui-loadmore').show();
			if(!content){
				$('#iosDialog2').show();
				$('.weui-dialog__title').text('内容不能为空');
				$('.weui-dialog__bd').text('请填写您要输入的内容');
				
				return false;

			}
			if(!link){
				$('#iosDialog2').show();
				$('.weui-dialog__title').text('链接不能为空');
				$('.weui-dialog__bd').text('请填写您要输入的链接');
				return false;
			}
			$.post("{:U('Policy/Index/Submitedit')}",{'content':content,'link':link,'id':id},function(e){
				if(e == 1){
					$('.weui-loadmore').hide();
					$('.weui-dialog__bd').text('编辑成功'); console.log(e);
					$('#iosDialog2').show();
					
				}else{
					$('.weui-loadmore').hide();
					$('.weui-dialog__bd').text('编辑失败'); console.log(e);
					$('#iosDialog2').show();

				}
			})
			
		})

		$('#qr').click(function(){
			$('#iosDialog2').hide();
		})
		
	})
</script>
<style>
	a:link,a:visited{
	 text-decoration:none;  /*超链接无下划线*/
	}
	a:hover{
	 text-decoration:none;  /*鼠标放上去有下划线*/
	}
	p{
		margin:0 0;
	}
	body {
              font-family:Microsoft YaHei;
           }
	 #footer{
                margin-top:30%;
        }
          .weui-cells{
                margin-top: 0.2em;

            }
</style>
</html>
